# from algorithms.detect.yolov7.yolov7_inferencer import YoloV7Inferencer
from algorithms import YoloV7Inferencer

if __name__ == "__main__":
    # 初始化推理器，指定模型路径（可使用本地模型或自动下载）
    detector = YoloV7Inferencer("/home/song/Codes/yolov7/runs/train/yolov7_zfx4/weights/best.pt")

    # 图像路径（请替换为你自己的测试图片）
    image_path = "/home/song/Codes/refind_algorithm_library/data/images/tank01.jpg"

    # 执行检测
    result = detector.detect_image(image_path)

    # 输出检测结果（可选：保存或打印）
    print("检测结果：")
    for idx, obj in enumerate(result):
        print(f"对象 {idx+1}: {obj}")

    # 可视化检测结果
    detector.visualize(image_path, result)